{"ast":null,"code":"var _jsxFileName = \"/data/messenger.client/src/components/Avatar/index.tsx\";\nimport React from \"react\";\nimport { generateAvatarByNickname } from \"../../utils/helpers\";\nimport './Avatar.scss';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\nimport { Fragment as _Fragment } from \"react/jsx-dev-runtime\";\nconst Avatar = _ref => {\n  let {\n    contentList,\n    alt,\n    stringForGenerateColor,\n    stringForFirstCharacter,\n    shortAvatar = true\n  } = _ref;\n  if (contentList && contentList.items && contentList.items.length > 0 && shortAvatar) {\n    return /*#__PURE__*/_jsxDEV(\"img\", {\n      className: \"avatar\",\n      src: contentList.items[0].link,\n      alt: 'Avatar ' + alt\n    }, void 0, false, {\n      fileName: _jsxFileName,\n      lineNumber: 10,\n      columnNumber: 13\n    }, this);\n  } else if (shortAvatar) {\n    const {\n      colors\n    } = generateAvatarByNickname(stringForGenerateColor);\n    const firstChar = stringForFirstCharacter[0].toUpperCase();\n    return /*#__PURE__*/_jsxDEV(\"div\", {\n      style: {\n        background: `linear-gradient(135deg, ${colors.color} 0%, ${colors.colorLighten} 96.52%)`\n      },\n      className: \"avatar avatar--symbol\",\n      children: firstChar\n    }, void 0, false, {\n      fileName: _jsxFileName,\n      lineNumber: 17,\n      columnNumber: 13\n    }, this);\n  } else {\n    if (contentList) {\n      console.log( /*#__PURE__*/_jsxDEV(_Fragment, {\n        children: contentList.items.map((item, index) => {\n          return /*#__PURE__*/_jsxDEV(\"img\", {\n            className: \"avatar\",\n            src: item.link,\n            alt: 'Avatar ' + alt\n          }, void 0, false, {\n            fileName: _jsxFileName,\n            lineNumber: 29,\n            columnNumber: 25\n          }, this);\n        })\n      }, void 0, false));\n      return /*#__PURE__*/_jsxDEV(_Fragment, {}, void 0, false);\n    } else {\n      return /*#__PURE__*/_jsxDEV(_Fragment, {}, void 0, false);\n    }\n  }\n};\n_c = Avatar;\nexport default Avatar;\nvar _c;\n$RefreshReg$(_c, \"Avatar\");","map":{"version":3,"names":["React","generateAvatarByNickname","Avatar","contentList","alt","stringForGenerateColor","stringForFirstCharacter","shortAvatar","items","length","link","colors","firstChar","toUpperCase","background","color","colorLighten","console","log","map","item","index"],"sources":["/data/messenger.client/src/components/Avatar/index.tsx"],"sourcesContent":["import React from \"react\";\nimport {AvatarProps} from \"../../models/props/AvatarProps\";\nimport { generateAvatarByNickname } from \"../../utils/helpers\";\nimport './Avatar.scss';\nimport {Carousel} from \"../index\";\n\nconst Avatar: React.FC<AvatarProps> = ({contentList, alt, stringForGenerateColor, stringForFirstCharacter, shortAvatar = true}) => {\n    if (contentList && contentList.items && contentList.items.length > 0 && shortAvatar) {\n        return (\n            <img className='avatar' src={contentList.items[0].link} alt={'Avatar ' + alt}/>\n        );\n    } else if (shortAvatar) {\n        const {colors} = generateAvatarByNickname(stringForGenerateColor);\n        const firstChar = stringForFirstCharacter[0].toUpperCase();\n\n        return (\n            <div\n                style={{background: `linear-gradient(135deg, ${colors.color} 0%, ${colors.colorLighten} 96.52%)`}}\n                className='avatar avatar--symbol'\n            >\n                {firstChar}\n            </div>\n        );\n    } else {\n        if (contentList) {\n            console.log(<>\n                {contentList.items.map((item, index) => {\n                    return (\n                        <img className='avatar' src={item.link} alt={'Avatar ' + alt}/>\n                    );\n                })}\n            </>);\n            return (\n                <></>\n            );\n        } else {\n            return <></>;\n        }\n    }\n}\n\nexport default Avatar;\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,wBAAwB,QAAQ,qBAAqB;AAC9D,OAAO,eAAe;AAAC;AAAA;AAGvB,MAAMC,MAA6B,GAAG,QAA6F;EAAA,IAA5F;IAACC,WAAW;IAAEC,GAAG;IAAEC,sBAAsB;IAAEC,uBAAuB;IAAEC,WAAW,GAAG;EAAI,CAAC;EAC1H,IAAIJ,WAAW,IAAIA,WAAW,CAACK,KAAK,IAAIL,WAAW,CAACK,KAAK,CAACC,MAAM,GAAG,CAAC,IAAIF,WAAW,EAAE;IACjF,oBACI;MAAK,SAAS,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